import type { IColumnsOption } from 'vc';
import { INDEX, INFO_SOURCE } from '@/utils';

export function useTable() {
  const tableData = ref<any[]>([]);

  const columns = ref<IColumnsOption[]>([
    { ...INDEX },
    {
      title: '披露日期',
      field: 'noticeDate',
      width: 100,
      align: 'center',
      sortable: true,
      sortBy: 'noticeDate'
    },
    { ...INFO_SOURCE('') },
    {
      title: '纳入年度',
      field: 'statisticalYear',
      width: 100
    },
    {
      title: '所属类别',
      field: 'companyType'
    },
    {
      title: '最低责任限额',
      field: 'liabilityLimit'
    },
    {
      title: '认定单位',
      field: 'certificateAuthority'
    }
  ]);

  return {
    tableData,
    columns
  };
}
